<?php
class PNPostsArray extends PNObjectExArray {
  function PNPostsArray($init=null, $where='')
  {
    $this->PNObject();

    $this->_objType       = 'icarrent_posts';
    $this->_objField      = 'id';
    $this->_objPath       = 'form';

    $this->_init($init, $where);
  }
  function selectExtendResult(){
    $id = FormUtil::getPassedValue ('id', false);
    //$result = array();
    if ($id){
      return DBUtil::selectObject('icarrent_topics', "WHERE tpc_id = '$id'");
    }
  }

  function genFilter(){
    $id = FormUtil::getPassedValue ('id', false);
    $where = '';
    if ($id){
      $where = "WHERE pst_topics_id = '$id'";
    }
    return $where;
  }
  function genSort(){
    return "ORDER BY pst_id DESC";
  }
}